package com.project.mapper;

import com.project.bean.ProductBean;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface IProductMapper {
    @Insert("insert into t_product(p_name,p_factory,p_price,p_createDate) values" +
            "(#{name},#{factory},#{price},#{createDate})")
    public void add(ProductBean product);
    @Delete("delete from t_product where pk_productId=#{id}")
    public void del(Integer id);
    @Update("update t_product set p_price=#{price} where pk_productId=#{id}")
    public void update(@Param("id") Integer id,@Param("price") Integer price);
    @Select("select * from t_product")
    @ResultMap("productMap")
    public List<ProductBean> findAll();
}
